/**
 * Copyright 2013-2015
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */	  

package com.cos.service.interfaces.role;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.cos.dao.DaoSupport;
import com.cos.util.PageData;

/**
 *   功能定制Service
 * <p/>
 * 
 * @author <a href="mailto:978954852@qq.com">xfjin</a>
 * @version  Date: 2016年4月1日 下午2:12:43
 * @serial 1.0
 * @since 2016年4月1日 下午2:12:43
 */
@Service("intMenuService")
public class IntMenuService {

	@Resource(name = "daoSupport")
	private DaoSupport dao;
	
	/**
	 * 获取用户功能定制列表
	 * @param pd
	 * @return
	 * @throws Exception 
	 */
	@SuppressWarnings("unchecked")
	public List<PageData> getMenuByUID(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("RoleMapper.getMenuByUID", pd);
	}

	/**
	 * 初始化用户的menu菜单
	 * @param U_ID 
	 * @param object 
	 * @param menuList 
	 * @throws Exception 
	 */
	public void insertUserMenu(PageData pd) throws Exception {
		dao.save("RoleMapper.insertUserMenu", pd);
	}

	
	/**
	 * 获取系统设置的用户菜单
	 * @param pd
	 * @return
	 * @throws Exception
	 */
	@SuppressWarnings("unchecked")
	public List<PageData> getUserMenu(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("RoleMapper.getUserMenu", pd);
	}
	
	/**
	 * 获取系统设置的公司菜单
	 * @param pd
	 * @return
	 * @throws Exception
	 */
	@SuppressWarnings("unchecked")
	public List<PageData> getCompanyMenu(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("RoleMapper.getCompanyMenu", pd);
	}

	/**
	 *  初始化公司的menu菜单
	 * @param pd
	 * @throws Exception 
	 */
	public void insertCompanyMenu(PageData pd) throws Exception {
		dao.save("RoleMapper.insertCompanyMenu", pd);
	}
	
	
	/**
	 * 获取公司功能定制列表
	 * @param pd
	 * @return
	 * @throws Exception 
	 */
	@SuppressWarnings("unchecked")
	public List<PageData> getMenuByCID(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("RoleMapper.getMenuByCID", pd);
	}


	/**
	 * 首页里的我的里面的更多 那个功能
	 * @param pd
	 * @return
	 * @throws Exception
	 */
	@SuppressWarnings("unchecked")
	public List<PageData> getMoreUserMenu(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("RoleMapper.getMoreUserMenu", pd);
	}

	/**
	 * 首页里的公司里面的更多 那个功能
	 * @param pd
	 * @return
	 * @throws Exception 
	 */
	@SuppressWarnings("unchecked")
	public List<PageData> getMoreCompanyMenu(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("RoleMapper.getMoreCompanyMenu", pd);
	}

	/**
	 * 我的里面更多功能里面去新增功能
	 * @param pd
	 * @throws Exception
	 */
	public void updateUserMenu(PageData pd) throws Exception {
		dao.update("RoleMapper.updateUserMenu", pd);
	}

	/**
	 * 公司里面更多功能里面去新增功能
	 * @param pd
	 * @throws Exception
	 */
	public void updateCompanyMenu(PageData pd) throws Exception {
		dao.update("RoleMapper.updateCompanyMenu", pd);
	}

	

	
		
}
